﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class BigSurgery : System.Web.UI.Page
{
    Connectdbnour con = new Connectdbnour();
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (RadioButtonList1.SelectedItem.ToString() == "Left")
        {
            DropDownList10.Enabled = false;
            DropDownList12.Enabled = false;
            DropDownList14.Enabled = false;
            DropDownList9.Enabled = true;
            DropDownList11.Enabled = true;
            DropDownList13.Enabled = true;
        }
        else if (RadioButtonList1.SelectedItem.ToString() == "Right")
        {
            DropDownList9.Enabled = false;
            DropDownList11.Enabled = false;
            DropDownList13.Enabled = false;
            DropDownList10.Enabled = true;
            DropDownList12.Enabled = true;
            DropDownList14.Enabled = true;
        }
        else if (RadioButtonList1.SelectedItem.ToString() == "Both")
        {
            DropDownList9.Enabled = true;
            DropDownList11.Enabled = true;
            DropDownList13.Enabled = true;
            DropDownList10.Enabled = true;
            DropDownList12.Enabled = true;
            DropDownList14.Enabled = true;
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (RadioButtonList1.SelectedItem.ToString() == "Left")
        {
            con.insertbigsurgery(TextBox1.Text, Convert.ToDouble(TextBox2.Text), Convert.ToInt16(TextBox3.Text), Convert.ToInt16(TextBox4.Text), Convert.ToDouble(DropDownList9.SelectedItem.ToString()), Convert.ToDouble(DropDownList11.SelectedItem.ToString()), Convert.ToDouble(DropDownList13.SelectedItem.ToString()), 000, 000, 000, TextBox5.Text, DropDownList18.SelectedItem.ToString() + "-" + DropDownList17.SelectedItem.ToString() + "-" + DropDownList16.SelectedItem.ToString(), TextBox6.Text, Convert.ToDouble(TextBox7.Text), Convert.ToDouble(TextBox8.Text), Convert.ToDouble(TextBox9.Text));
        }
        else if (RadioButtonList1.SelectedItem.ToString() == "Right")
        {
            con.insertbigsurgery(TextBox1.Text, Convert.ToDouble(TextBox2.Text), Convert.ToInt16(TextBox3.Text), Convert.ToInt16(TextBox4.Text), 000, 000, 000, Convert.ToDouble(DropDownList10.SelectedItem.ToString()), Convert.ToDouble(DropDownList12.SelectedItem.ToString()), Convert.ToDouble(DropDownList14.SelectedItem.ToString()), TextBox5.Text, DropDownList18.SelectedItem.ToString() + "-" + DropDownList17.SelectedItem.ToString() + "-" + DropDownList16.SelectedItem.ToString(), TextBox6.Text, Convert.ToDouble(TextBox7.Text), Convert.ToDouble(TextBox8.Text), Convert.ToDouble(TextBox9.Text));
        }
        else if (RadioButtonList1.SelectedItem.ToString() == "Both")
        {
            con.insertbigsurgery(TextBox1.Text, Convert.ToDouble(TextBox2.Text), Convert.ToInt16(TextBox3.Text), Convert.ToInt16(TextBox4.Text), Convert.ToDouble(DropDownList9.SelectedItem.ToString()), Convert.ToDouble(DropDownList11.SelectedItem.ToString()), Convert.ToDouble(DropDownList13.SelectedItem.ToString()), Convert.ToDouble(DropDownList10.SelectedItem.ToString()), Convert.ToDouble(DropDownList12.SelectedItem.ToString()), Convert.ToDouble(DropDownList14.SelectedItem.ToString()), TextBox5.Text, DropDownList18.SelectedItem.ToString() + "-" + DropDownList17.SelectedItem.ToString() + "-" + DropDownList16.SelectedItem.ToString(), TextBox6.Text, Convert.ToDouble(TextBox7.Text), Convert.ToDouble(TextBox8.Text), Convert.ToDouble(TextBox9.Text));
        }
        Response.Redirect("BigSurgery.aspx");
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        con.bigsurgeryrest(DropDownList19.SelectedItem.ToString(), DropDownList20.SelectedItem.ToString(), DropDownList22.SelectedItem.ToString() + "-" + DropDownList21.SelectedItem.ToString() + "-" + DropDownList23.SelectedItem.ToString());
        Response.Redirect("BigSurgery.aspx");
    }
}